#include "customlabel.h"
#include <QMouseEvent>
#include <QPainter>
CustomLabel::CustomLabel(QWidget* object):QLabel(object)
{
   // setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextEditable| Qt::LinksAccessibleByMouse);
}

void CustomLabel::mousePressEvent(QMouseEvent *event)
{
    if (event->type() == QEvent::MouseButtonDblClick) {
        hasFocus = true;
    }
}

void CustomLabel::keyPressEvent(QKeyEvent *event)
{
    if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
        hasFocus = false;
    }
}

